<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('角色添加')" />
</head>
<body>
	<section class="content">
		<form class="form-horizontal" id="roleForm" method = 'post' th:action="@{/role/add}">
           <div class="box-body">
               <div class="form-group">
                   <label for="name" class="col-sm-3 control-label">角色名称 :</label>
                   <div class="col-sm-8">
                       <input type="text" class="form-control" name="name" id="name" require="必填项"  placeholder="">
                   </div>
               </div>
               <div class="form-group">
                   <label for="description" class="col-sm-3 control-label">角色描述 :</label>
                   <div class="col-sm-8">
                       <input type="text" class="form-control" name="description" id="description" placeholder="">
                   </div>
               </div>
           </div>
       </form>
	</section>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		function submitHandler() {
			if(doValidForm(roleForm)){
                $.common.postAjax("/role/doAdd",$("#roleForm").serialize(),function (data) {
                    if(data.status==200){
                    	parent.layer.closeAll('iframe'); // 关闭当前frame
						parent.$.table.refreshTable();
						parent.toastr.success(data.msg);
					} else {
						parent.toastr.error(data.msg);
					}
                })
            }
		}
	</script>
</body>
</html>